<?php

class Application_Form_Materiel extends Zend_Form
{

    public function init()
    {
        $this->setName('materiel');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');
        
        

        $nom= new Zend_Form_Element_Text('nom');
        $nom->setLabel('Fonction du materiel (ex:PC Compta)')
        		-> setRequired(true);
        

        $type = new Zend_Form_Element_Select('type') ;
        $type->setLabel('Type de materiel')      
        		->addMultiOptions(array('0' => 'Selectionnez...','PC' => 'Ordinateur', 'LAPTOP' => 'Ordinateur Portable', 'PRINT' => 'Imprimante', 'MAINFRAME' => 'Serveur', 'TAB' => 'Tablette'));

        $modele=new Zend_Form_Element_Text('modele');
        $modele->setLabel('Modele')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        		

                Zend_Loader::loadfile('ReseauSelect.php',APPLICATION_PATH.'/forms/element/',false);
       $idReseau = new Application_Form_Element_ReseauSelect('idReseau');
       $idReseau->setLabel('Reseau') 
       			->setRequired(true);       
        
        $numeroPoste=new Zend_Form_Element_Text('numeroPoste');
        $numeroPoste->setLabel('Numero du Poste')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
         
        $dateAchat = new Zend_Form_Element_Text('dateAchat');
        $dateAchat-> setRequired(true)
        			->setLabel("Date de l'achat");
                
        $prix=new Zend_Form_Element_Text('prix');
        $prix->setLabel('Prix')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        
         $this->addElements(array($id,$nom,$type,$modele,$idReseau,$numeroPoste,$dateAchat,$prix));        
    }


}

